<?php
include ('../model/connect.php');
include ('../model/Staff/class-course.php');

// add the header line to specify that the content type is JSON
header("Content-type: application/json");

// determine the request type
$verb = $_SERVER["REQUEST_METHOD"];

// handle a GET 
if ($verb == "GET") {
	$arr = array();

	$rs = mysql_query("SELECT * FROM course");

	while($obj = mysql_fetch_object($rs)) {

		$arr[] = $obj;

	}
	echo "{\"data\":" .json_encode($arr). "}";
}


?>